<?php

class Categories{

	
	private $_id;
	private $_description;	


	function __construct(){

	}



	public function getAll(){

		// obtiene todas las categorias
		$con = mysql_query("SELECT * FROM categories where 1");		
					
		if(mysql_num_rows($con) != 0){
			if(mysql_num_rows($con)==1)
				//un solo registro
				$data = mysql_fetch_array($con);
			else{ 
				//conjunto de registros
				while($cat=mysql_fetch_array($con)){
					$data[] = $cat;
				}			
			}
		}else{
			//no tiene registros
			$data = null;
		}

		return $data;
	}



	public function getId(){
		return $this->_id;
	}

	public function getDescription(){
		return $this->_description;
	}

	




	
	}	
